<?php
	
	require 'configDB.php';

	$NIK = $_POST['NIK'];
	$tingkat = $_POST['tingkat'];
	$id_jurusan = $_POST['id_jurusan'];
	$no_kelas = $_POST['no_kelas'];
	$id = $_POST['id'];

	$kelas_query = mysql_query("SELECT * FROM kelas WHERE tingkat='$tingkat' AND id_jurusan='$id_jurusan' AND nomor='$no_kelas'");
	$kelas= mysql_fetch_assoc($kelas_query);
	$id_kelas = $kelas['id'];

	$query = mysql_query("UPDATE penugasan_wali SET NIK='$NIK', id_kelas='$id_kelas' WHERE id='$id'");

	header("Location: ../laporan_penugasan_walikelas.php");

?>